-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revised docs deployments #947
Revised docs deployments #947
Conversation
25967d6
to
d7a8fc1
Compare
mkdir -p /tmp/docs_build | ||
cp -r docs/build/html/* /tmp/docs_build/ | ||
rm -rf ${{ env.RELEASE_VERSION }}/* | ||
echo '<html><head><meta http-equiv="refresh" content="0; url=stable/" /></head></html>' > index.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
url=stable
, is it correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes. gh-pages can only serve single set of static pages so the redirecting to the 'stable' should be the default docs to this repo.
echo SOURCE_NAME=${GITHUB_REF#refs/*/} >> $GITHUB_OUTPUT | ||
echo SOURCE_BRANCH=${GITHUB_REF#refs/heads/} >> $GITHUB_OUTPUT | ||
echo SOURCE_TAG=${GITHUB_REF#refs/tags/} >> $GITHUB_OUTPUT | ||
existed_in_remote=$(git ls-remote --heads origin gh-pages) | ||
|
||
if [[ -z ${existed_in_remote} ]]; then | ||
echo "Creating gh-pages branch" | ||
git config --local user.email "action@github.com" | ||
git config --local user.name "GitHub Action" | ||
git checkout --orphan gh-pages | ||
git reset --hard | ||
touch .nojekyll | ||
git add .nojekyll | ||
git commit -m "Initializing gh-pages branch" | ||
git push origin gh-pages | ||
git checkout ${{steps.branch_name.outputs.SOURCE_NAME}} | ||
echo "Created gh-pages branch" | ||
else | ||
echo "Branch gh-pages already exists" | ||
fi | ||
- name: Commit docs to gh-pages branch | ||
run: | | ||
git fetch | ||
git checkout gh-pages | ||
mkdir -p /tmp/docs_build | ||
cp -r docs/build/html/* /tmp/docs_build/ | ||
rm -rf ${{ env.RELEASE_VERSION }}/* | ||
echo '<html><head><meta http-equiv="refresh" content="0; url=stable/" /></head></html>' > index.html | ||
mkdir -p ${{ env.RELEASE_VERSION }} | ||
cp -r /tmp/docs_build/* ./${{ env.RELEASE_VERSION }} | ||
ln -sfn ${{ env.RELEASE_VERSION }} stable | ||
rm -rf /tmp/docs_build | ||
git config --local user.email "action@github.com" | ||
git config --local user.name "GitHub Action" | ||
git add ./index.html ./stable ${{ env.RELEASE_VERSION }} | ||
git commit -m "Update documentation" -a || true | ||
- name: Push changes | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recommend you to wrap up the common part. For example,
uses: ./.github/workflows/notify_teams.yml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's good idea but I don't have enough idea at this moment because the commit steps need to update different links - stable
and latest
. I will try to apply such idea later.
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## releases/1.2.0 #947 +/- ##
==================================================
+ Coverage 78.64% 78.70% +0.06%
==================================================
Files 228 232 +4
Lines 26342 26420 +78
Branches 5249 5258 +9
==================================================
+ Hits 20717 20795 +78
+ Misses 4406 4400 -6
- Partials 1219 1225 +6
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 6 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Summary
Revised documentation deployments. There are two different workflows.
develop
)The gh-pages environment for this repo will serve the documentations from latest release as default. (https://openvinotoolkit.github.io/datumaro/)
but the documentations generated by the latest develop or previous releases could be used by using the different URL like below:
Checklist
License
Feel free to contact the maintainers if that's a concern.